package com.demo.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.util.ConverterUtils;
import com.atguigu.utils.R;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ExcelListener extends AnalysisEventListener<ReadData> {
    //创建list集合封装最终的数据
    List<ReadData> list = new ArrayList<ReadData>();
    private final ArrayList<ReadData> ReadData = new ArrayList<ReadData>();

    //表体内容
    @Override
    public void invoke(ReadData readData, AnalysisContext analysisContext) {
        System.out.println("***"+readData);
        list.add(readData);
    }
    //表头信息
    public void invokeHead(Map<Integer, CellData> headMap, AnalysisContext context) {
        System.out.println("***表头信息"+headMap);
    }
    //读取完成后执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

}
